import request from 'utils/request.js'
import { usersStore } from 'store/users.js';
const store = usersStore();
export default class Api extends request{
	constructor(){
		super()
	}
	//登录
	wxLogin(data){
		return this.post('/jeecg-boot/app/login/wxLogin',data)
	}
	//获取树形地址数据
	treeList(){
		return this.get('/jeecg-boot/backend/jurisdictionConfig/treeList')
	}
	//获取不同证件验证规则
	getRegex(data){
		return this.get('/jeecg-boot/app/dict/getRegex',data)
	}
	//修改头像
	setting(data){
		return this.post('/jeecg-boot/app/user/setting',data)
	}
	//删除文件
	deleteFile(data){
		return this.delete('/jeecg-boot/app/upload/deleteFile',data)
	}
	//分页列表查询
	list(apiUrl,data){
		return this.get('/jeecg-boot/app/'+apiUrl+'/list',{...data,userId:store.users.id,place:store.users.place,roleType:store.users.roleType})
	}
	//添加
	add(apiUrl,data){
		return this.post('/jeecg-boot/app/'+apiUrl+'/add',{...data,userId:store.users.id,roleType:store.users.roleType})
	}
	//删除
	deleteData(apiUrl,data){
		return this.delete('/jeecg-boot/app/'+apiUrl+'/delete',data)
	}
	//详情
	queryById(apiUrl,data){
		return this.get('/jeecg-boot/app/'+apiUrl+'/queryById', { ...data, roleType: store.users.roleType })
	}
	//编辑
	edit(apiUrl,data){
		return this.put('/jeecg-boot/app/'+apiUrl+'/edit',data)
	}
	//上报
	report(apiUrl,data){
		return this.post('/jeecg-boot/app/'+apiUrl+'/report',data)
	}
	//获取字典
	dict(data){
		return this.get('/jeecg-boot/app/dict/list',data)
	}
	//ocr识别
	ocr(data){
		return this.get('/jeecg-boot/app/ocr/distinguish',data)
	}
	//国籍
	nationInfo(){
		return this.post('/jeecg-boot/app/overseasPopulation/nationInfo')
	}
}